package validator

import "fmt"

type ErrRequired struct {
	field string
}

func (e *ErrRequired) Error() string    { return fmt.Sprintf("field [%s] is required", e.field) }
func NewErrRequired(field string) error { return &ErrRequired{field: field} }

type ErrType struct {
	field string
	given string
	need  string
}

func (e *ErrType) Error() string {
	return fmt.Sprintf("field [%s]'s type is %s, got %s", e.field, e.need, e.given)
}
func NewErrType(field, given, need string) error {
	return &ErrType{field: field, given: given, need: need}
}
